package com.yoso.starter.boot.enums;

import lombok.Getter;

/**
 * <p>
 *   导入类型
 * </p>
 *
 * @author shizejin
 * @version 1.0
 * @date 2023/5/24 9:37
 */
public enum UploadType {
    COVER(1, "覆盖导入"),

    DIFFERENCE(2, "差异导入");


    @Getter
    private final Integer code;
    @Getter
    private final String name;

    UploadType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static UploadType getByCode(Integer code) {
        UploadType[] enums = values();
        for (UploadType typeEnum : enums) {
            if (typeEnum.getCode().equals(code)) {
                return typeEnum;
            }
        }
        return null;
    }
}